home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / pvm34b3.zip / pvm34b3 / pvm3 / src / tevmac.h < prev    next >
C/C++ Source or Header  |  1997-07-22  |  5KB  |  172 lines

  1.  
  2. /* $Id: tevmac.h,v 1.5 1997/06/25 22:11:13 pvmsrc Exp $ */
  3.  
  4. /*
  5.  *         PVM version 3.4:  Parallel Virtual Machine System
  6.  *               University of Tennessee, Knoxville TN.
  7.  *           Oak Ridge National Laboratory, Oak Ridge TN.
  8.  *                   Emory University, Atlanta GA.
  9.  *      Authors:  J. J. Dongarra, G. E. Fagg, M. Fischer
  10.  *          G. A. Geist, J. A. Kohl, R. J. Manchek, P. Mucci,
  11.  *         P. M. Papadopoulos, S. L. Scott, and V. S. Sunderam
  12.  *                   (C) 1997 All Rights Reserved
  13.  *
  14.  *                              NOTICE
  15.  *
  16.  * Permission to use, copy, modify, and distribute this software and
  17.  * its documentation for any purpose and without fee is hereby granted
  18.  * provided that the above copyright notice appear in all copies and
  19.  * that both the copyright notice and this permission notice appear in
  20.  * supporting documentation.
  21.  *
  22.  * Neither the Institutions (Emory University, Oak Ridge National
  23.  * Laboratory, and University of Tennessee) nor the Authors make any
  24.  * representations about the suitability of this software for any
  25.  * purpose.  This software is provided ``as is'' without express or
  26.  * implied warranty.
  27.  *
  28.  * PVM version 3 was funded in part by the U.S. Department of Energy,
  29.  * the National Science Foundation and the State of Tennessee.
  30.  */
  31.  
  32. /*
  33.  *    tevmac.h
  34.  *
  35.  *    Tracing defs.
  36.  *
  37. $Log: tevmac.h,v $
  38.  * Revision 1.5  1997/06/25  22:11:13  pvmsrc
  39.  * Markus adds his frigging name to the author list of
  40.  *     every file he ever looked at...
  41.  *
  42.  * Revision 1.4  1997/04/30  21:33:25  pvmsrc
  43.  * SGI Compiler Warning Cleanup.
  44.  *     - stupid ##@%&@(...  made explicit boolean expressions out of
  45.  *         assignments inside TEV_EXCLUSIVE conditional.  :-Q
  46.  *
  47.  * Revision 1.3  1997/01/28  19:28:35  pvmsrc
  48.  * New Copyright Notice & Authors.
  49.  *
  50.  * Revision 1.2  1996/10/24  21:49:50  pvmsrc
  51.  * Modified for New Tracing Facility:
  52.  *     - added new struct pvmtrcencvec for trace event packing.
  53.  *     - modified tracing macros:
  54.  *         * TEV_DO_TRACE() requires 2 args now, kind & entry_exit.
  55.  *         * TEV_FIN(), tev_fin() now requires no args.
  56.  *         * TEV_DECLS, no need for xtrcbuf, xtrcsbf now.
  57.  *     - added TEV_PACK_*() macros for trace event contents,
  58.  *         for performance, uses enc_*() routines directly.
  59.  *
  60.  * Revision 1.1  1996/09/23  23:43:37  pvmsrc
  61.  * Initial revision
  62.  *
  63.  * Revision 1.1  1994/06/03  20:38:32  manchek
  64.  * Initial revision
  65.  *
  66.  */
  67.  
  68.  
  69. /*****************************
  70.  **  Internal Trace Structs **
  71.  **                         **
  72.  *****************************/
  73.  
  74. struct pvmtrcencvec {
  75.     int (*enc_byte)();
  76.     int (*enc_cplx)();
  77.     int (*enc_dcplx)();
  78.     int (*enc_double)();
  79.     int (*enc_float)();
  80.     int (*enc_int)();
  81.     int (*enc_uint)();
  82.     int (*enc_long)();
  83.     int (*enc_ulong)();
  84.     int (*enc_short)();
  85.     int (*enc_ushort)();
  86.     int (*enc_str)();
  87. };
  88.  
  89.  
  90. void tev_init();
  91. void tev_flush();
  92.  
  93.  
  94. /*****************************
  95.  **  Internal Trace Macros  **
  96.  **                         **
  97.  *****************************/
  98.  
  99. /* to check that task is connected without a function call */
  100.  
  101. #define    BEATASK    ( pvmmytid == -1 ? pvmbeatask() : 0 )
  102.  
  103. /* check tracing on event kind */
  104.  
  105. #define TEV_CHECK_TRACE( _kind ) \
  106.     ( !BEATASK && pvmtrc.trctid > 0 && pvmtrc.trctid != pvmmytid \
  107.         && TEV_MASK_CHECK( pvmtrc.tmask, _kind ) )
  108.  
  109. /* check tracing and generate start message */
  110.  
  111. #define    TEV_DO_TRACE( _kind, _entry_exit ) \
  112.     ( TEV_CHECK_TRACE( _kind ) && tev_begin( _kind, _entry_exit ) )
  113.  
  114. #define    TEV_FIN    tev_fin()
  115.  
  116. #define    TEV_DECLS        int xamtraced;
  117. #define    TEV_EXCLUSIVE    ( (xamtraced = pvmtoplvl) != 0 \
  118.                             && (pvmtoplvl = 0) == 0 )
  119. #define    TEV_AMEXCL        xamtraced
  120. #define    TEV_ENDEXCL        (pvmtoplvl = xamtraced)
  121.  
  122. /* packing macros */
  123.  
  124. #define TEV_PACK_BYTE( _did, _array, _datap, _cnt, _std ) \
  125.     (pvmtrccodef->enc_byte)( _did, _array, \
  126.         (void *)(_datap), _cnt, _std )
  127.  
  128. #define TEV_PACK_CPLX( _did, _array, _datap, _cnt, _std ) \
  129.     (pvmtrccodef->enc_cplx)( _did, _array, \
  130.         (void *)(_datap), _cnt, _std )
  131.  
  132. #define TEV_PACK_DCPLX( _did, _array, _datap, _cnt, _std ) \
  133.     (pvmtrccodef->enc_dcplx)( _did, _array, \
  134.         (void *)(_datap), _cnt, _std )
  135.  
  136. #define TEV_PACK_DOUBLE( _did, _array, _datap, _cnt, _std ) \
  137.     (pvmtrccodef->enc_double)( _did, _array, \
  138.         (void *)(_datap), _cnt, _std )
  139.  
  140. #define TEV_PACK_FLOAT( _did, _array, _datap, _cnt, _std ) \
  141.     (pvmtrccodef->enc_float)( _did, _array, \
  142.         (void *)(_datap), _cnt, _std )
  143.  
  144. #define TEV_PACK_INT( _did, _array, _datap, _cnt, _std ) \
  145.     (pvmtrccodef->enc_int)( _did, _array, \
  146.         (void *)(_datap), _cnt, _std )
  147.  
  148. #define TEV_PACK_UINT( _did, _array, _datap, _cnt, _std ) \
  149.     (pvmtrccodef->enc_uint)( _did, _array, \
  150.         (void *)(_datap), _cnt, _std )
  151.  
  152. #define TEV_PACK_LONG( _did, _array, _datap, _cnt, _std ) \
  153.     (pvmtrccodef->enc_long)( _did, _array, \
  154.         (void *)(_datap), _cnt, _std )
  155.  
  156. #define TEV_PACK_ULONG( _did, _array, _datap, _cnt, _std ) \
  157.     (pvmtrccodef->enc_ulong)( _did, _array, \
  158.         (void *)(_datap), _cnt, _std )
  159.  
  160. #define TEV_PACK_SHORT( _did, _array, _datap, _cnt, _std ) \
  161.     (pvmtrccodef->enc_short)( _did, _array, \
  162.         (void *)(_datap), _cnt, _std )
  163.  
  164. #define TEV_PACK_USHORT( _did, _array, _datap, _cnt, _std ) \
  165.     (pvmtrccodef->enc_ushort)( _did, _array, \
  166.         (void *)(_datap), _cnt, _std )
  167.  
  168. #define TEV_PACK_STRING( _did, _array, _datap, _cnt, _std ) \
  169.     (pvmtrccodef->enc_str)( _did, _array, \
  170.         (void *)(_datap), _cnt, _std )
  171.  
  172.